package com.service.impl;


import com.dao.AreaMapper;
import com.entity.Areas;
import com.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: honye-fang
 * @description:
 * @author: Baiyyy
 * @create: 2025-02-14 13:50
 **/
@Service
public class AreaServiceImpl implements AreaService {
    @Autowired
    private AreaMapper areaMapper;


    /**
     * 获取所有省级区域
     */
    public List<Areas> getProvince() {
        return areaMapper.findProvince();
    }

    /**
     * 根据省级区域id获取市级区域
     */

    public List<Areas> getCityByProvinceId(Integer provinceId) {
        return areaMapper.findCityByProvinceId(provinceId);
    }

    /**
     * 根据市级区域id获取县级区域
     */
    public List<Areas> getAreaByCityId(Integer cityId) {
        return areaMapper.findAreaByCityId(cityId);
    }

}
